vpath %.java generated
vpath %.java generated/FIPA
vpath %.class classes

vpath %.java ZoneCalculator
vpath %.java ObjectClassification
vpath %.java TrajectoryAnalysis
vpath %.java SpeedAnalysis
vpath %.java GlobalAnalysis

all: ENAService.class SpeedService.class TrajectoryService.class PAService.class

PAServer.class: PAServer.java PAI.java
TrajectoryServer.class: TrajectoryServer.java TAI.java
SpeedServer.class: SpeedServer.java SAI.java
ENAServer.class: ENAServer.java ENAI.java
ENAService.class: ENAService.java ENAI.java
SpeedService.class: SpeedService.java SAI.java
TrajectoryService.class: TrajectoryService.java TAI.java
PAService.class: PAService.java PAI.java

%.class:
	slice2java ../slice/Oculus.ice ../slice/Types.ice ../slice/Anormality.ice --output-dir generated -I/usr/share/slice
	javac -d classes -classpath .:generated:classes:ZoneCalculator:ObjectClassification:TrajectoryAnalysis:SpeedAnalysis:GlobalAnalysis:/usr/share/java/Ice.jar:/usr/share/java/mysql.jar $<

clean:
	$(RM) -rf *~
	$(RM) -rf classes/*
	$(RM) -rf generated/*
	$(RM) -rf ZoneCalculator/*.class
	$(RM) -rf ObjectClassification/*.class
	$(RM) -rf TrajectoryAnalysis/*.class
	$(RM) -rf SpeedAnalysis/*.class
	$(RM) -rf GlobalAnalysis/*.class
